const Child = {
  props: ["index"],
  render(h) {
    return h("p", `text_${this.index}`);
  },
};
export default {
  data() {
    return {
      show: true,
    };
  },
  render(h) {
    let childNode;
    let child = Array.apply(null, {
      length: 5,
    }).map((item, index) => {
      return h(Child, {
        props: {
          index,
        },
      });
    });
    if (this.show) {
      childNode = h("div", child);
    } else {
      childNode = h("p", "内容2");
    }
    return h(
      "div",
      {
        attrs: {
          id: "main",
        },
        class: {
          container: true,
        },
        style: {
          color: "red",
        },
      },
      [childNode]
    );
  },
};
